package com.schoolvisitors.controller.admin;

import com.schoolvisitors.CheckPermission;
import com.schoolvisitors.enums.PermissionEnum;
import com.schoolvisitors.response.ResultBody;
import com.schoolvisitors.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/admin")
public class DashboardController {


    private final DashboardService dashboardService;
    @Autowired
    public DashboardController(DashboardService dashboardService) {
        this.dashboardService = dashboardService;
    }

//    @CheckPermission(PermissionEnum.SYSTEM_ADMIN)
    @GetMapping("/dashboardStats")
    public ResultBody getDashboardStats() {
        return ResultBody.success(dashboardService.getDashboardStats());
    }
}